home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / TextServices.a < prev    next >
Encoding:
Text File  |  1993-12-02  |  6.6 KB  |  263 lines  |  [TEXT/MPS ]

  1. ;    File:        TextServices.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__TSMAINCLUDE__') = 'UNDEFINED' THEN
  12. __TSMAINCLUDE__        SET        1
  13.  
  14.  
  15. kTSMVersion                        equ        1            ; Version of the Text Services Manager
  16. kTextService                    equ        'tsvc'    ; component type for the component description
  17. kInputMethodService            equ        'inpm'    ; component subtype for the component description
  18. ;;-------------------------------------------------------------------------;;
  19.  
  20.  
  21. tsmUnsupScriptLanguageErr    EQU        -2500        ;
  22. tsmInputMethodNotFoundErr    EQU        -2501        ;
  23. tsmNotAnAppErr                    EQU        -2502        ; not an application error
  24. tsmAlreadyRegisteredErr        EQU        -2503        ; want to register again error
  25. tsmNeverRegisteredErr        EQU        -2504        ; app is not TSM aware error
  26. tsmInvalidDocIDErr            EQU        -2505        ; invalid TSM documentation id
  27. tsmTSMDocBusyErr                EQU        -2506        ; document is still active
  28. tsmDocNotActiveErr            EQU        -2507        ; document is NOT active
  29. tsmNoOpenTSErr                    EQU        -2508        ; no open text service
  30. tsmCantOpenComponentErr        EQU        -2509        ; can't open the component
  31. tsmTextServiceNotFoundErr    EQU        -2510        ; no text service found
  32. tsmDocumentOpenErr            EQU        -2511        ; there are open documents
  33. tsmUseInputWindowErr            EQU        -2512        ; not TSM aware because we are using input window
  34. tsmTSHasNoMenuErr                EQU        -2513        ; the text service has no menu
  35. tsmTSNotOpenErr                EQU        -2514        ; no open text service to close
  36. tsmComponentAlreadyOpenErr    EQU        -2515        ; text service already opened for the document
  37.  
  38. tsmInputMethodIsOldErr        EQU        -2516        ; returned by GetDefaultInputMethod ONLY
  39. tsmScriptHasNoIMErr            EQU        -2517        ; script has no imput method or is using old IM.
  40. tsmUnsupportedTypeErr        EQU        -2518        ; unSupported interface type error
  41. tsmUnknownErr                    EQU        -2519        ; any other errors
  42.  
  43. ;;-------------------------------------------------------------------------;;
  44.  
  45.  
  46.  
  47.  
  48.  
  49. _TSMDispatch                OPWORD        $AA54    ; should be moved later
  50. TSMTrapNumber                EQU            $AA54
  51.  
  52.  
  53. ;    Text Services Manager function selectors ...
  54.  
  55. kNewTSMDocument                equ        0        ; create new TSM aware document
  56. kDeleteTSMDocument            equ        1        ; delete TSM aware document
  57. kActivateTSMDocument            equ        2        ; activate TSM aware document
  58. kDeactivateTSMDocument        equ        3        ; deactivate TSM aware document
  59. kTSMEvent                        equ        4        ; pass all events to TSM
  60. kTSMMenuSelect                    equ        5        ; pass menu selection to TSM
  61. kSetTSMCursor                    equ        6        ; set the cursor
  62. kFixTSMDocument                equ        7        ; terminate text services
  63. kGetServiceList                equ        8        ; get all text service components
  64. kOpenTextService                equ        9        ; open  the text service
  65. kCloseTextService                equ        10        ; close the text service
  66. kSendAEFromTSMComponent        equ        11        ; send Apple Event from component to client
  67.  
  68.  
  69. ;; Utilities ...
  70.  
  71. kSetDefaultInputMethod        equ        12        ;
  72. kGetDefaultInputMethod        equ        13        ; (Get = D)
  73. kSetTextServiceLanguage        equ        14        ; 
  74. kGetTextServiceLanguage        equ        15        ; 
  75. kUseInputWindow                equ        16        ; 
  76. kNewServiceWindow                equ        17        ; 
  77. kCloseServiceWindow            equ        18        ; 
  78. kGetFrontServiceWindow        equ        19        ; 
  79.  
  80.  
  81. kInitTSMAwareApplication    equ        20        ; claim TSM aware application
  82. kCloseTSMAwareApplication    equ        21        ; application deregisters itself as TSM aware
  83. kFindServiceWindow            equ        23
  84.  
  85. ;;-------------------------------------------------------------------------;;
  86.  
  87.  
  88.  
  89. ;; Low level routines which are dispatched directly to the Component Manager ...
  90. kCMGetScriptLangSupport        equ        $00040001            ; 
  91. kCMInitiateTextService        equ        $00000002            ; 
  92. kCMTerminateTextService        equ        $00000003            ; 
  93. kCMActivateTextService        equ        $00000004            ; 
  94. kCMDeactivateTextService    equ        $00000005            ; 
  95. kCMTextServiceEvent            equ        $00060006            ; 
  96. kCMGetTextServiceMenu        equ        $00040007            ; 
  97. kCMTextServiceMenuSelect    equ        $00060008            ; 
  98. kCMFixTextService                equ        $00000009            ; 
  99. kCMSetTextServiceCursor        equ        $0004000A            ; 
  100.  
  101. ;;-------------------------------------------------------------------------;;
  102.  
  103.  
  104.  
  105. ;; trap routine macros ...
  106.  
  107.                   macro
  108.                   _NewTSMDocument
  109.                   move.w  #kNewTSMDocument,d0
  110.                   _TSMDispatch
  111.                   endm
  112.  
  113.  
  114.                   macro
  115.                   _DeleteTSMDocument
  116.                   move.w  #kDeleteTSMDocument,d0
  117.                   _TSMDispatch
  118.                   endm
  119.  
  120.  
  121.                   macro
  122.                   _ActivateTSMDocument
  123.                   move.w  #kActivateTSMDocument,d0
  124.                   _TSMDispatch
  125.                   endm
  126.  
  127.  
  128.                   macro
  129.                   _DeactivateTSMDocument
  130.                   move.w  #kDeactivateTSMDocument,d0
  131.                   _TSMDispatch
  132.                   endm
  133.   
  134.                   macro
  135.                   _TSMEvent
  136.                   move.w  #kTSMEvent,d0
  137.                   _TSMDispatch
  138.                   endm
  139.   
  140.                   macro
  141.                   _TSMMenuSelect
  142.                   move.w  #kTSMMenuSelect,d0
  143.                   _TSMDispatch
  144.                   endm
  145.  
  146.                   macro
  147.                   _SetTSMCursor
  148.                   move.w  #kSetTSMCursor,d0
  149.                   _TSMDispatch
  150.                   endm
  151.  
  152.                   macro
  153.                   _FixTSMDocument
  154.                   move.w  #kFixTSMDocument,d0
  155.                   _TSMDispatch
  156.                   endm
  157.  
  158.                   macro
  159.                   _GetServiceList
  160.                   move.w  #kGetServiceList,d0
  161.                   _TSMDispatch
  162.                   endm
  163.  
  164.                   macro
  165.                   _OpenTextService
  166.                   move.w  #kOpenTextService,d0
  167.                   _TSMDispatch
  168.                   endm
  169.  
  170.                 macro
  171.                   _CloseTextService
  172.                   move.w  #kCloseTextService,d0
  173.                   _TSMDispatch
  174.                   endm
  175.                 
  176.                   macro
  177.                   _SendAEFromTSMComponent
  178.                   move.w  #kSendAEFromTSMComponent,d0                        ; kSendAEFromTSMComponent = 11
  179.                   _TSMDispatch
  180.                   endm
  181.  
  182.                   macro
  183.                   _InitTSMAwareApplication
  184.                   move.w  #kInitTSMAwareApplication,d0
  185.                   _TSMDispatch
  186.                   endm
  187.  
  188.  
  189.                   macro
  190.                   _CloseTSMAwareApplication
  191.                   move.w  #kCloseTSMAwareApplication,d0
  192.                   _TSMDispatch
  193.                   endm
  194.                 
  195.                   macro
  196.                   _SetDefaultInputMethod
  197.                   move.w  #kSetDefaultInputMethod,d0
  198.                   _TSMDispatch
  199.                   endm
  200.  
  201.                   macro
  202.                   _GetDefaultInputMethod
  203.                   move.w  #kGetDefaultInputMethod,d0
  204.                   _TSMDispatch
  205.                   endm
  206.  
  207.                   macro
  208.                   _SetTextServiceLanguage
  209.                   move.w  #kSetTextServiceLanguage,d0
  210.                   _TSMDispatch
  211.                   endm
  212.  
  213.                   macro
  214.                   _GetTextServiceLanguage
  215.                   move.w  #kGetTextServiceLanguage,d0
  216.                   _TSMDispatch
  217.                   endm
  218.  
  219.                   macro
  220.                   _UseInputWindow
  221.                   move.w  #kUseInputWindow,d0
  222.                   _TSMDispatch
  223.                   endm
  224.  
  225.                   macro
  226.                   _NewServiceWindow
  227.                   move.w  #kNewServiceWindow,d0
  228.                   _TSMDispatch
  229.                   endm
  230.  
  231.                   macro
  232.                   _CloseServiceWindow
  233.                   move.w  #kCloseServiceWindow,d0
  234.                   _TSMDispatch
  235.                   endm
  236.  
  237.                   macro
  238.                   _GetFrontServiceWindow
  239.                   move.w  #kGetFrontServiceWindow,d0
  240.                   _TSMDispatch
  241.                   endm
  242.  
  243.                   macro
  244.                   _FindServiceWindow
  245.                   move.w  #kFindServiceWindow,d0
  246.                   _TSMDispatch
  247.                   endm
  248.  
  249.  
  250. kUnknownScript        EQU            $FFFF                ; undefined script
  251. kUnknownLanguage    EQU            $FFFF                ; undefined language
  252.  
  253.  
  254. ScriptLanguageRec    RECORD        0
  255. fScript                ds.w            1                     ; (word) script code
  256. fLanguage            ds.w            1                     ; (word) language code
  257.                         ENDR
  258.  
  259.  
  260.  
  261.  
  262.  
  263.         ENDIF                ; ...already included